package graduation.project.utilities;

import graduation.project.body.OriginExpression;
import graduation.project.body.TestCases;
import graduation.project.exception.NonExpressionException;

import java.awt.List;
import java.util.ArrayList;

public class Client {

	public static void main(String[] args){
		try {			
//			String[] expArr = {"!a!b+!ab+a!b", "ab(c+d+e+f+g+h+i+j+k+l)", "ab!c+ab!d+abe", "(a!b+a!c+!a!d)e", "!a!bc+!b!dc", 
//					"cdf(a!e+!bc+!cg)!(h!i)", "!a+!b+!c+!d+!e+!f+!g+!h", "abc(!i+!j+!k)", "defgh(!i+!j+!k)", "!a(b+d+e)+!cfi+g!ij", 
//					"!ac!d(e+f)+b(!g+!h)i!jk", "!l+!m+!n+!o+!p", "ab!c(!l+!m+!n+!o+!p)", "!af(i+j)+bc!g(!k+!l)!np", "b!ceg+!dcf(ko+!lm!p)", 
//					"a!c!d!f+!b(cj+lm!n)+gl(!n+o!p)", "def!g(i+!lm+!m!no)", "lm(!n!o+n!p)",	"a(bc+def)+aghi", 
//					"!a!(bd+c!e)(jk+l!mn)+j!l!m!n(opq+roq)", "stu(vx+vw+wx)", "!jk(mn+lo!q+!op)(!st!v+!t!uw+!tv!x)",
//					"ab(!lm+l!mn!o+m!n!o+jko!p)", "a!bc(op!q+d!m!pq)(stuv+!su!v!w)", "(!ac!e+acef)(uv!w!x+mnop+ik!l!h)"};
//			
			String expression = "!jk(mn+lo!q+!op)";
			
			OriginExpression originEx;
			TestCases tcs;
			String strategy = "MUMCUT";
			ArrayList<TestCases> li = new ArrayList<TestCases>();
//			String idnf 
			originEx = new OriginExpression(expression);
			/*int[][][] nfp = originEx.getNfpSet();
			for(int i = 0; i < nfp.length; i++)
				for(int j = 0; j < nfp[i].length; j++)
					for(int k = 0; k < nfp[i][j].length; k++)
						System.out.println("i: " + i + ", j: " + j + ", k: " + k + ", data: " + nfp[i][j][k]);
			
			System.out.println("utp");
			int[][] utp = originEx.getUtpSet();
			for(int i = 0; i < utp.length; i++)
				for(int j = 0; j < utp[i].length; j++)
					System.out.println("i: " + i + ", j: " + j + ", date: " + utp[i][j]);*/
			tcs = originEx.generateTestCases(strategy);
			System.out.println("size: " + tcs.getTestSet().size());
			/*for(int i = 0; i < expArr.length; i++){
				originEx = new OriginExpression(expArr[i]);
				System.out.println("i: " + originEx.getModel().length());
//				tcs = originEx.generateTestCases(strategy);
//				li.add(tcs);
			}*/
			
//			for(int i = 0; i < li.size(); i++)
//				System.out.println("i=" + i + ": " + li.get(i).getTestSet().size());
			
		} catch (NonExpressionException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
	}
}
